<template>
  <el-form
    ref="customerRefForm"
    label-width="110px"
    style="max-width: 95%"
    :data="customer"
  >
    <el-form-item label="负责人">
      <div class="desc">{{ customerDetail.ownerDO.name }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="所属活动">
      <div class="desc">{{ customerDetail.activityDO.name }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="姓名">
      <div class="desc">{{ customerDetail.clueDO.fullName }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="称呼">
      <div class="desc">{{ customerDetail.appellationDO.typeValue }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="手机">
      <div class="desc">{{ customerDetail.clueDO.phone }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="微信">
      <div class="desc">{{ customerDetail.clueDO.weixin }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="QQ">
      <div class="desc">{{ customerDetail.clueDO.qq }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="邮箱">
      <div class="desc">{{ customerDetail.clueDO.email }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="年龄">
      <div class="desc">{{ customerDetail.clueDO.age }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="职业">
      <div class="desc">{{ customerDetail.clueDO.job }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="年收入">
      <div class="desc">{{ customerDetail.clueDO.yearIncome }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="住址">
      <div class="desc">{{ customerDetail.clueDO.address }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="贷款">
      <div class="desc">{{ customerDetail.needLoanDO.typeValue }}&nbsp;</div>
    </el-form-item>

    <el-form-item label="选购产品">
      <div class="desc">{{ customerDetail.productDO.name }}&nbsp;</div>
    </el-form-item>
    <el-form-item label="客户描述">
      <div class="desc">{{ customerDetail.description }}&nbsp;</div>
    </el-form-item>
    <el-form-item label="下次联系时间">
      <div class="desc">{{ customerDetail.createTime }}&nbsp;</div>
    </el-form-item>
    <el-form-item label="创建人">
      <div class="desc">{{ customerDetail.createDO.name }}&nbsp;</div>
    </el-form-item>
    <el-form-item label="创建时间">
      <div class="desc">{{ customerDetail.createTime }}&nbsp;</div>
    </el-form-item>
    <el-form-item>
      <el-button type="success" plain @click="goBack"
        >返 回</el-button
      ></el-form-item
    >
  </el-form>
</template>
<script setup>
import { reactive, ref, onMounted, getCurrentInstance } from "vue";
import { doGet, doPost, doDelete, doPut } from "@/http/httpRequest";
import { useRoute } from "vue-router";
import { goBack } from "../util/util";
const route = useRoute();
let customerDetail = reactive({
  clueDO: {},
  ownerDO: {},
  activityDO: {},
  appellationDO: {},
  needLoanDO: {},
  intentionStateDO: {},
  stateDO: {},
  sourceDO: {},
  productDO: {},
  createDO: {},
});
onMounted(() => {
  loadCustomerDetail();
});
function loadCustomerDetail() {
  let id = route.params.id;
  doGet("/api/customer/" + id, {}).then((resp) => {
    if (resp.data.code === 200) {
      Object.assign(customerDetail, resp.data.data);
      console.log(customerDetail);
    }
  });
}
goBack;
</script>
<style scoped>
</style>